/*******************************************************************************
 * CBNews.m
 * ComicsBlog
 *
 * Adrien Bougouin <adrien.bougouin@gmail.com>
 */

#import "CBNews.h"

@implementation CBNews

@synthesize _identifier;
@synthesize _title;
@synthesize _author;
@synthesize _pubDate;
@synthesize _hdImage;
@synthesize _image;
@synthesize _file;
@synthesize _description;
@synthesize _category;
@synthesize _type;

- (id) initWithID:(NSUInteger) identifier
            title:(NSString *) title
           author:(NSString *) author
          pubDate:(NSString *) pubDate
          hdImage:(NSString *) hdImage
            image:(NSString *) image
             file:(NSString *) file
      description:(NSString *) description
         category:(NSUInteger) category
             type:(NSString *) type {
  self = [super init];

  if(self) {
    _identifier = identifier;
    if(title) {
      _title = [title retain];
    } else {
      _title = [[NSString alloc] init];
    }
    if(author) {
      _author = [author retain];
    } else {
      _author = [[NSString alloc] init];
    }
    if(pubDate) {
      _pubDate = [pubDate retain];
    } else {
      _pubDate = [[NSString alloc] init];
    }
    if(hdImage) {
      _hdImage = [hdImage retain];
    } else {
      _hdImage = [[NSString alloc] init];
    }
    if(image) {
      _image = [image retain];
    } else {
      _image = [[NSString alloc] init];
    }
    if(file) {
      _file = [file retain];
    } else {
      _file = [[NSString alloc] init];
    }
    if(description) {
      _description = [description retain];
    } else {
      _description = [[NSString alloc] init];
    }
    _category = category;
    if(type) {
      _type = [type retain];
    } else {
      _type = [[NSString alloc] init];
    }
  }

  return self;
}

- (void) dealloc {
  [super dealloc];

  [_title       release];
  [_author      release];
  [_pubDate     release];
  [_hdImage     release];
  [_image       release];
  [_file        release];
  [_description release];
  [_type        release];
}

@end

